package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

//编写webService服务接口
public interface CustomerService {

	// 查询所有为关联客户
	@Path("/noassociationcustomers")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomers();

	// 查询所有已关联到指定定区客户
	@Path("/associationfixedareacustomers/{fixedareaid}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findHasAssociationFixedAreaCustomers
		(@PathParam("fixedareaid") String fixedAreaId);

	// 将客户关联到定区
	@Path("/associationcustomertofixedarea")
	@PUT
	@Consumes({ "application/xml", "application/json" })
	public void associationCustomerToFixedArea(
			@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);
	
	//保存注册用户信息
	@Path("/customer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void regist(Customer customer);
	
	//根据手机号查询客户
	@Path("/customer/telephone/{telephone}")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public Customer findByTelephone(@PathParam("telephone") String telephone);
	
	//修改用户邮箱绑定状态（激活邮箱）
	@Path("/customer/update/{telephone}")
	@PUT
	public void updateType(@PathParam("telephone") String telephone);
	
	//用户登录服务
	@Path("/customer/login")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public Customer login(@QueryParam("telephone") String telephone,
			@QueryParam("password") String password);
	
	//根据客户地址返回定区编码
	@Path("/customer/findFixedAreaIdByAddress")
	@GET
	@Consumes({"application/xml","application/json"})
	public String findFixedAreaIdByAddress(@QueryParam("address") String address);
}
